Option Strict On
Option Explicit On 

Public Class Browse
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

        cboSizeMode.Items.Clear()
        cboSizeMode.Items.Add(Model10.SizeMode.Clip)
        cboSizeMode.Items.Add(Model10.SizeMode.Stretch)
        cboSizeMode.Items.Add(Model10.SizeMode.Zoom)
        cboSizeMode.SelectedItem = Model10.SizeMode.Clip
    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents btnOk As System.Windows.Forms.Button
    Friend WithEvents btnCancel As System.Windows.Forms.Button
    Friend WithEvents cboSizeMode As System.Windows.Forms.ComboBox
    Friend WithEvents lblSizeMode As System.Windows.Forms.Label
    Friend WithEvents picImage As System.Windows.Forms.PictureBox
    Friend WithEvents btnRemove As System.Windows.Forms.Button
    Friend WithEvents btnSave As System.Windows.Forms.Button
    Friend WithEvents btnEdit As System.Windows.Forms.Button
    Friend WithEvents txtImage As System.Windows.Forms.TextBox
    Friend WithEvents btnScan As System.Windows.Forms.Button
    Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Browse))
        Me.picImage = New System.Windows.Forms.PictureBox
        Me.btnOk = New System.Windows.Forms.Button
        Me.btnCancel = New System.Windows.Forms.Button
        Me.btnEdit = New System.Windows.Forms.Button
        Me.txtImage = New System.Windows.Forms.TextBox
        Me.cboSizeMode = New System.Windows.Forms.ComboBox
        Me.lblSizeMode = New System.Windows.Forms.Label
        Me.btnRemove = New System.Windows.Forms.Button
        Me.btnSave = New System.Windows.Forms.Button
        Me.btnScan = New System.Windows.Forms.Button
        Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
        Me.SuspendLayout()
        '
        'picImage
        '
        Me.picImage.AccessibleDescription = resources.GetString("picImage.AccessibleDescription")
        Me.picImage.AccessibleName = resources.GetString("picImage.AccessibleName")
        Me.picImage.Anchor = CType(resources.GetObject("picImage.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.picImage.BackColor = System.Drawing.SystemColors.AppWorkspace
        Me.picImage.BackgroundImage = CType(resources.GetObject("picImage.BackgroundImage"), System.Drawing.Image)
        Me.picImage.Dock = CType(resources.GetObject("picImage.Dock"), System.Windows.Forms.DockStyle)
        Me.picImage.Enabled = CType(resources.GetObject("picImage.Enabled"), Boolean)
        Me.picImage.Font = CType(resources.GetObject("picImage.Font"), System.Drawing.Font)
        Me.picImage.Image = CType(resources.GetObject("picImage.Image"), System.Drawing.Image)
        Me.picImage.ImeMode = CType(resources.GetObject("picImage.ImeMode"), System.Windows.Forms.ImeMode)
        Me.picImage.Location = CType(resources.GetObject("picImage.Location"), System.Drawing.Point)
        Me.picImage.Name = "picImage"
        Me.picImage.RightToLeft = CType(resources.GetObject("picImage.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.picImage.Size = CType(resources.GetObject("picImage.Size"), System.Drawing.Size)
        Me.picImage.SizeMode = CType(resources.GetObject("picImage.SizeMode"), System.Windows.Forms.PictureBoxSizeMode)
        Me.picImage.TabIndex = CType(resources.GetObject("picImage.TabIndex"), Integer)
        Me.picImage.TabStop = False
        Me.picImage.Text = resources.GetString("picImage.Text")
        Me.picImage.Visible = CType(resources.GetObject("picImage.Visible"), Boolean)
        '
        'btnOk
        '
        Me.btnOk.AccessibleDescription = resources.GetString("btnOk.AccessibleDescription")
        Me.btnOk.AccessibleName = resources.GetString("btnOk.AccessibleName")
        Me.btnOk.Anchor = CType(resources.GetObject("btnOk.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.btnOk.BackgroundImage = CType(resources.GetObject("btnOk.BackgroundImage"), System.Drawing.Image)
        Me.btnOk.Dock = CType(resources.GetObject("btnOk.Dock"), System.Windows.Forms.DockStyle)
        Me.btnOk.Enabled = CType(resources.GetObject("btnOk.Enabled"), Boolean)
        Me.btnOk.FlatStyle = CType(resources.GetObject("btnOk.FlatStyle"), System.Windows.Forms.FlatStyle)
        Me.btnOk.Font = CType(resources.GetObject("btnOk.Font"), System.Drawing.Font)
        Me.btnOk.Image = CType(resources.GetObject("btnOk.Image"), System.Drawing.Image)
        Me.btnOk.ImageAlign = CType(resources.GetObject("btnOk.ImageAlign"), System.Drawing.ContentAlignment)
        Me.btnOk.ImageIndex = CType(resources.GetObject("btnOk.ImageIndex"), Integer)
        Me.btnOk.ImeMode = CType(resources.GetObject("btnOk.ImeMode"), System.Windows.Forms.ImeMode)
        Me.btnOk.Location = CType(resources.GetObject("btnOk.Location"), System.Drawing.Point)
        Me.btnOk.Name = "btnOk"
        Me.btnOk.RightToLeft = CType(resources.GetObject("btnOk.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.btnOk.Size = CType(resources.GetObject("btnOk.Size"), System.Drawing.Size)
        Me.btnOk.TabIndex = CType(resources.GetObject("btnOk.TabIndex"), Integer)
        Me.btnOk.Text = resources.GetString("btnOk.Text")
        Me.btnOk.TextAlign = CType(resources.GetObject("btnOk.TextAlign"), System.Drawing.ContentAlignment)
        Me.btnOk.Visible = CType(resources.GetObject("btnOk.Visible"), Boolean)
        '
        'btnCancel
        '
        Me.btnCancel.AccessibleDescription = resources.GetString("btnCancel.AccessibleDescription")
        Me.btnCancel.AccessibleName = resources.GetString("btnCancel.AccessibleName")
        Me.btnCancel.Anchor = CType(resources.GetObject("btnCancel.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.btnCancel.BackgroundImage = CType(resources.GetObject("btnCancel.BackgroundImage"), System.Drawing.Image)
        Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.btnCancel.Dock = CType(resources.GetObject("btnCancel.Dock"), System.Windows.Forms.DockStyle)
        Me.btnCancel.Enabled = CType(resources.GetObject("btnCancel.Enabled"), Boolean)
        Me.btnCancel.FlatStyle = CType(resources.GetObject("btnCancel.FlatStyle"), System.Windows.Forms.FlatStyle)
        Me.btnCancel.Font = CType(resources.GetObject("btnCancel.Font"), System.Drawing.Font)
        Me.btnCancel.Image = CType(resources.GetObject("btnCancel.Image"), System.Drawing.Image)
        Me.btnCancel.ImageAlign = CType(resources.GetObject("btnCancel.ImageAlign"), System.Drawing.ContentAlignment)
        Me.btnCancel.ImageIndex = CType(resources.GetObject("btnCancel.ImageIndex"), Integer)
        Me.btnCancel.ImeMode = CType(resources.GetObject("btnCancel.ImeMode"), System.Windows.Forms.ImeMode)
        Me.btnCancel.Location = CType(resources.GetObject("btnCancel.Location"), System.Drawing.Point)
        Me.btnCancel.Name = "btnCancel"
        Me.btnCancel.RightToLeft = CType(resources.GetObject("btnCancel.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.btnCancel.Size = CType(resources.GetObject("btnCancel.Size"), System.Drawing.Size)
        Me.btnCancel.TabIndex = CType(resources.GetObject("btnCancel.TabIndex"), Integer)
        Me.btnCancel.Text = resources.GetString("btnCancel.Text")
        Me.btnCancel.TextAlign = CType(resources.GetObject("btnCancel.TextAlign"), System.Drawing.ContentAlignment)
        Me.btnCancel.Visible = CType(resources.GetObject("btnCancel.Visible"), Boolean)
        '
        'btnEdit
        '
        Me.btnEdit.AccessibleDescription = resources.GetString("btnEdit.AccessibleDescription")
        Me.btnEdit.AccessibleName = resources.GetString("btnEdit.AccessibleName")
        Me.btnEdit.Anchor = CType(resources.GetObject("btnEdit.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.btnEdit.BackgroundImage = CType(resources.GetObject("btnEdit.BackgroundImage"), System.Drawing.Image)
        Me.btnEdit.Dock = CType(resources.GetObject("btnEdit.Dock"), System.Windows.Forms.DockStyle)
        Me.btnEdit.Enabled = CType(resources.GetObject("btnEdit.Enabled"), Boolean)
        Me.btnEdit.FlatStyle = CType(resources.GetObject("btnEdit.FlatStyle"), System.Windows.Forms.FlatStyle)
        Me.btnEdit.Font = CType(resources.GetObject("btnEdit.Font"), System.Drawing.Font)
        Me.btnEdit.Image = CType(resources.GetObject("btnEdit.Image"), System.Drawing.Image)
        Me.btnEdit.ImageAlign = CType(resources.GetObject("btnEdit.ImageAlign"), System.Drawing.ContentAlignment)
        Me.btnEdit.ImageIndex = CType(resources.GetObject("btnEdit.ImageIndex"), Integer)
        Me.btnEdit.ImeMode = CType(resources.GetObject("btnEdit.ImeMode"), System.Windows.Forms.ImeMode)
        Me.btnEdit.Location = CType(resources.GetObject("btnEdit.Location"), System.Drawing.Point)
        Me.btnEdit.Name = "btnEdit"
        Me.btnEdit.RightToLeft = CType(resources.GetObject("btnEdit.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.btnEdit.Size = CType(resources.GetObject("btnEdit.Size"), System.Drawing.Size)
        Me.btnEdit.TabIndex = CType(resources.GetObject("btnEdit.TabIndex"), Integer)
        Me.btnEdit.Text = resources.GetString("btnEdit.Text")
        Me.btnEdit.TextAlign = CType(resources.GetObject("btnEdit.TextAlign"), System.Drawing.ContentAlignment)
        Me.btnEdit.Visible = CType(resources.GetObject("btnEdit.Visible"), Boolean)
        '
        'txtImage
        '
        Me.txtImage.AccessibleDescription = resources.GetString("txtImage.AccessibleDescription")
        Me.txtImage.AccessibleName = resources.GetString("txtImage.AccessibleName")
        Me.txtImage.Anchor = CType(resources.GetObject("txtImage.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.txtImage.AutoSize = CType(resources.GetObject("txtImage.AutoSize"), Boolean)
        Me.txtImage.BackgroundImage = CType(resources.GetObject("txtImage.BackgroundImage"), System.Drawing.Image)
        Me.txtImage.BorderStyle = System.Windows.Forms.BorderStyle.None
        Me.txtImage.Dock = CType(resources.GetObject("txtImage.Dock"), System.Windows.Forms.DockStyle)
        Me.txtImage.Enabled = CType(resources.GetObject("txtImage.Enabled"), Boolean)
        Me.txtImage.Font = CType(resources.GetObject("txtImage.Font"), System.Drawing.Font)
        Me.txtImage.ImeMode = CType(resources.GetObject("txtImage.ImeMode"), System.Windows.Forms.ImeMode)
        Me.txtImage.Location = CType(resources.GetObject("txtImage.Location"), System.Drawing.Point)
        Me.txtImage.MaxLength = CType(resources.GetObject("txtImage.MaxLength"), Integer)
        Me.txtImage.Multiline = CType(resources.GetObject("txtImage.Multiline"), Boolean)
        Me.txtImage.Name = "txtImage"
        Me.txtImage.PasswordChar = CType(resources.GetObject("txtImage.PasswordChar"), Char)
        Me.txtImage.ReadOnly = True
        Me.txtImage.RightToLeft = CType(resources.GetObject("txtImage.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.txtImage.ScrollBars = CType(resources.GetObject("txtImage.ScrollBars"), System.Windows.Forms.ScrollBars)
        Me.txtImage.Size = CType(resources.GetObject("txtImage.Size"), System.Drawing.Size)
        Me.txtImage.TabIndex = CType(resources.GetObject("txtImage.TabIndex"), Integer)
        Me.txtImage.Text = resources.GetString("txtImage.Text")
        Me.txtImage.TextAlign = CType(resources.GetObject("txtImage.TextAlign"), System.Windows.Forms.HorizontalAlignment)
        Me.txtImage.Visible = CType(resources.GetObject("txtImage.Visible"), Boolean)
        Me.txtImage.WordWrap = CType(resources.GetObject("txtImage.WordWrap"), Boolean)
        '
        'cboSizeMode
        '
        Me.cboSizeMode.AccessibleDescription = resources.GetString("cboSizeMode.AccessibleDescription")
        Me.cboSizeMode.AccessibleName = resources.GetString("cboSizeMode.AccessibleName")
        Me.cboSizeMode.Anchor = CType(resources.GetObject("cboSizeMode.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.cboSizeMode.BackgroundImage = CType(resources.GetObject("cboSizeMode.BackgroundImage"), System.Drawing.Image)
        Me.cboSizeMode.Dock = CType(resources.GetObject("cboSizeMode.Dock"), System.Windows.Forms.DockStyle)
        Me.cboSizeMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboSizeMode.Enabled = CType(resources.GetObject("cboSizeMode.Enabled"), Boolean)
        Me.cboSizeMode.Font = CType(resources.GetObject("cboSizeMode.Font"), System.Drawing.Font)
        Me.cboSizeMode.ImeMode = CType(resources.GetObject("cboSizeMode.ImeMode"), System.Windows.Forms.ImeMode)
        Me.cboSizeMode.IntegralHeight = CType(resources.GetObject("cboSizeMode.IntegralHeight"), Boolean)
        Me.cboSizeMode.ItemHeight = CType(resources.GetObject("cboSizeMode.ItemHeight"), Integer)
        Me.cboSizeMode.Location = CType(resources.GetObject("cboSizeMode.Location"), System.Drawing.Point)
        Me.cboSizeMode.MaxDropDownItems = CType(resources.GetObject("cboSizeMode.MaxDropDownItems"), Integer)
        Me.cboSizeMode.MaxLength = CType(resources.GetObject("cboSizeMode.MaxLength"), Integer)
        Me.cboSizeMode.Name = "cboSizeMode"
        Me.cboSizeMode.RightToLeft = CType(resources.GetObject("cboSizeMode.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.cboSizeMode.Size = CType(resources.GetObject("cboSizeMode.Size"), System.Drawing.Size)
        Me.cboSizeMode.TabIndex = CType(resources.GetObject("cboSizeMode.TabIndex"), Integer)
        Me.cboSizeMode.Text = resources.GetString("cboSizeMode.Text")
        Me.cboSizeMode.Visible = CType(resources.GetObject("cboSizeMode.Visible"), Boolean)
        '
        'lblSizeMode
        '
        Me.lblSizeMode.AccessibleDescription = resources.GetString("lblSizeMode.AccessibleDescription")
        Me.lblSizeMode.AccessibleName = resources.GetString("lblSizeMode.AccessibleName")
        Me.lblSizeMode.Anchor = CType(resources.GetObject("lblSizeMode.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.lblSizeMode.AutoSize = CType(resources.GetObject("lblSizeMode.AutoSize"), Boolean)
        Me.lblSizeMode.Dock = CType(resources.GetObject("lblSizeMode.Dock"), System.Windows.Forms.DockStyle)
        Me.lblSizeMode.Enabled = CType(resources.GetObject("lblSizeMode.Enabled"), Boolean)
        Me.lblSizeMode.Font = CType(resources.GetObject("lblSizeMode.Font"), System.Drawing.Font)
        Me.lblSizeMode.Image = CType(resources.GetObject("lblSizeMode.Image"), System.Drawing.Image)
        Me.lblSizeMode.ImageAlign = CType(resources.GetObject("lblSizeMode.ImageAlign"), System.Drawing.ContentAlignment)
        Me.lblSizeMode.ImageIndex = CType(resources.GetObject("lblSizeMode.ImageIndex"), Integer)
        Me.lblSizeMode.ImeMode = CType(resources.GetObject("lblSizeMode.ImeMode"), System.Windows.Forms.ImeMode)
        Me.lblSizeMode.Location = CType(resources.GetObject("lblSizeMode.Location"), System.Drawing.Point)
        Me.lblSizeMode.Name = "lblSizeMode"
        Me.lblSizeMode.RightToLeft = CType(resources.GetObject("lblSizeMode.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.lblSizeMode.Size = CType(resources.GetObject("lblSizeMode.Size"), System.Drawing.Size)
        Me.lblSizeMode.TabIndex = CType(resources.GetObject("lblSizeMode.TabIndex"), Integer)
        Me.lblSizeMode.Text = resources.GetString("lblSizeMode.Text")
        Me.lblSizeMode.TextAlign = CType(resources.GetObject("lblSizeMode.TextAlign"), System.Drawing.ContentAlignment)
        Me.lblSizeMode.Visible = CType(resources.GetObject("lblSizeMode.Visible"), Boolean)
        '
        'btnRemove
        '
        Me.btnRemove.AccessibleDescription = resources.GetString("btnRemove.AccessibleDescription")
        Me.btnRemove.AccessibleName = resources.GetString("btnRemove.AccessibleName")
        Me.btnRemove.Anchor = CType(resources.GetObject("btnRemove.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.btnRemove.BackgroundImage = CType(resources.GetObject("btnRemove.BackgroundImage"), System.Drawing.Image)
        Me.btnRemove.Dock = CType(resources.GetObject("btnRemove.Dock"), System.Windows.Forms.DockStyle)
        Me.btnRemove.Enabled = CType(resources.GetObject("btnRemove.Enabled"), Boolean)
        Me.btnRemove.FlatStyle = CType(resources.GetObject("btnRemove.FlatStyle"), System.Windows.Forms.FlatStyle)
        Me.btnRemove.Font = CType(resources.GetObject("btnRemove.Font"), System.Drawing.Font)
        Me.btnRemove.Image = CType(resources.GetObject("btnRemove.Image"), System.Drawing.Image)
        Me.btnRemove.ImageAlign = CType(resources.GetObject("btnRemove.ImageAlign"), System.Drawing.ContentAlignment)
        Me.btnRemove.ImageIndex = CType(resources.GetObject("btnRemove.ImageIndex"), Integer)
        Me.btnRemove.ImeMode = CType(resources.GetObject("btnRemove.ImeMode"), System.Windows.Forms.ImeMode)
        Me.btnRemove.Location = CType(resources.GetObject("btnRemove.Location"), System.Drawing.Point)
        Me.btnRemove.Name = "btnRemove"
        Me.btnRemove.RightToLeft = CType(resources.GetObject("btnRemove.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.btnRemove.Size = CType(resources.GetObject("btnRemove.Size"), System.Drawing.Size)
        Me.btnRemove.TabIndex = CType(resources.GetObject("btnRemove.TabIndex"), Integer)
        Me.btnRemove.Text = resources.GetString("btnRemove.Text")
        Me.btnRemove.TextAlign = CType(resources.GetObject("btnRemove.TextAlign"), System.Drawing.ContentAlignment)
        Me.btnRemove.Visible = CType(resources.GetObject("btnRemove.Visible"), Boolean)
        '
        'btnSave
        '
        Me.btnSave.AccessibleDescription = resources.GetString("btnSave.AccessibleDescription")
        Me.btnSave.AccessibleName = resources.GetString("btnSave.AccessibleName")
        Me.btnSave.Anchor = CType(resources.GetObject("btnSave.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.btnSave.BackgroundImage = CType(resources.GetObject("btnSave.BackgroundImage"), System.Drawing.Image)
        Me.btnSave.Dock = CType(resources.GetObject("btnSave.Dock"), System.Windows.Forms.DockStyle)
        Me.btnSave.Enabled = CType(resources.GetObject("btnSave.Enabled"), Boolean)
        Me.btnSave.FlatStyle = CType(resources.GetObject("btnSave.FlatStyle"), System.Windows.Forms.FlatStyle)
        Me.btnSave.Font = CType(resources.GetObject("btnSave.Font"), System.Drawing.Font)
        Me.btnSave.Image = CType(resources.GetObject("btnSave.Image"), System.Drawing.Image)
        Me.btnSave.ImageAlign = CType(resources.GetObject("btnSave.ImageAlign"), System.Drawing.ContentAlignment)
        Me.btnSave.ImageIndex = CType(resources.GetObject("btnSave.ImageIndex"), Integer)
        Me.btnSave.ImeMode = CType(resources.GetObject("btnSave.ImeMode"), System.Windows.Forms.ImeMode)
        Me.btnSave.Location = CType(resources.GetObject("btnSave.Location"), System.Drawing.Point)
        Me.btnSave.Name = "btnSave"
        Me.btnSave.RightToLeft = CType(resources.GetObject("btnSave.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.btnSave.Size = CType(resources.GetObject("btnSave.Size"), System.Drawing.Size)
        Me.btnSave.TabIndex = CType(resources.GetObject("btnSave.TabIndex"), Integer)
        Me.btnSave.Text = resources.GetString("btnSave.Text")
        Me.btnSave.TextAlign = CType(resources.GetObject("btnSave.TextAlign"), System.Drawing.ContentAlignment)
        Me.btnSave.Visible = CType(resources.GetObject("btnSave.Visible"), Boolean)
        '
        'btnScan
        '
        Me.btnScan.AccessibleDescription = resources.GetString("btnScan.AccessibleDescription")
        Me.btnScan.AccessibleName = resources.GetString("btnScan.AccessibleName")
        Me.btnScan.Anchor = CType(resources.GetObject("btnScan.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.btnScan.BackgroundImage = CType(resources.GetObject("btnScan.BackgroundImage"), System.Drawing.Image)
        Me.btnScan.Dock = CType(resources.GetObject("btnScan.Dock"), System.Windows.Forms.DockStyle)
        Me.btnScan.Enabled = CType(resources.GetObject("btnScan.Enabled"), Boolean)
        Me.btnScan.FlatStyle = CType(resources.GetObject("btnScan.FlatStyle"), System.Windows.Forms.FlatStyle)
        Me.btnScan.Font = CType(resources.GetObject("btnScan.Font"), System.Drawing.Font)
        Me.btnScan.Image = CType(resources.GetObject("btnScan.Image"), System.Drawing.Image)
        Me.btnScan.ImageAlign = CType(resources.GetObject("btnScan.ImageAlign"), System.Drawing.ContentAlignment)
        Me.btnScan.ImageIndex = CType(resources.GetObject("btnScan.ImageIndex"), Integer)
        Me.btnScan.ImeMode = CType(resources.GetObject("btnScan.ImeMode"), System.Windows.Forms.ImeMode)
        Me.btnScan.Location = CType(resources.GetObject("btnScan.Location"), System.Drawing.Point)
        Me.btnScan.Name = "btnScan"
        Me.btnScan.RightToLeft = CType(resources.GetObject("btnScan.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.btnScan.Size = CType(resources.GetObject("btnScan.Size"), System.Drawing.Size)
        Me.btnScan.TabIndex = CType(resources.GetObject("btnScan.TabIndex"), Integer)
        Me.btnScan.Text = resources.GetString("btnScan.Text")
        Me.btnScan.TextAlign = CType(resources.GetObject("btnScan.TextAlign"), System.Drawing.ContentAlignment)
        Me.btnScan.Visible = CType(resources.GetObject("btnScan.Visible"), Boolean)
        '
        'ImageList1
        '
        Me.ImageList1.ImageSize = CType(resources.GetObject("ImageList1.ImageSize"), System.Drawing.Size)
        Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
        Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
        '
        'Browse
        '
        Me.AcceptButton = Me.btnOk
        Me.AccessibleDescription = resources.GetString("$this.AccessibleDescription")
        Me.AccessibleName = resources.GetString("$this.AccessibleName")
        Me.AutoScaleBaseSize = CType(resources.GetObject("$this.AutoScaleBaseSize"), System.Drawing.Size)
        Me.AutoScroll = CType(resources.GetObject("$this.AutoScroll"), Boolean)
        Me.AutoScrollMargin = CType(resources.GetObject("$this.AutoScrollMargin"), System.Drawing.Size)
        Me.AutoScrollMinSize = CType(resources.GetObject("$this.AutoScrollMinSize"), System.Drawing.Size)
        Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image)
        Me.CancelButton = Me.btnCancel
        Me.ClientSize = CType(resources.GetObject("$this.ClientSize"), System.Drawing.Size)
        Me.Controls.Add(Me.btnScan)
        Me.Controls.Add(Me.btnSave)
        Me.Controls.Add(Me.btnRemove)
        Me.Controls.Add(Me.cboSizeMode)
        Me.Controls.Add(Me.lblSizeMode)
        Me.Controls.Add(Me.txtImage)
        Me.Controls.Add(Me.btnOk)
        Me.Controls.Add(Me.btnCancel)
        Me.Controls.Add(Me.picImage)
        Me.Controls.Add(Me.btnEdit)
        Me.Enabled = CType(resources.GetObject("$this.Enabled"), Boolean)
        Me.Font = CType(resources.GetObject("$this.Font"), System.Drawing.Font)
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.ImeMode = CType(resources.GetObject("$this.ImeMode"), System.Windows.Forms.ImeMode)
        Me.Location = CType(resources.GetObject("$this.Location"), System.Drawing.Point)
        Me.MaximumSize = CType(resources.GetObject("$this.MaximumSize"), System.Drawing.Size)
        Me.MinimumSize = CType(resources.GetObject("$this.MinimumSize"), System.Drawing.Size)
        Me.Name = "Browse"
        Me.RightToLeft = CType(resources.GetObject("$this.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.ShowInTaskbar = False
        Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show
        Me.StartPosition = CType(resources.GetObject("$this.StartPosition"), System.Windows.Forms.FormStartPosition)
        Me.Text = resources.GetString("$this.Text")
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private localImage As Image
    Private localBytes As Byte()

    Private mBrowse As Model10.Browse
    Private mCurrent As Model10.Current
    Private mReadOnly As Boolean

    Private Sub btnEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEdit.Click
        Dim s1 As String = "*.bmp;*.gif;*.jpg;*.jpeg;*.png;*.ico"
        Dim s2 As String = "*.emf;*.wmf"

        If txtImage.Text <> "" Then fMain.OpenFileDialog1.InitialDirectory = txtImage.Text
        fMain.OpenFileDialog1.Filter = mBrowse.Filter '"All image files(" & s1 & ";" & s2 & ")|" & s1 & ";" & s2 & "|Bitmap files(" & s1 & ")|" & s1 & "|Metafiles(" & s2 & ")|" & s2 & ""
        If fMain.OpenFileDialog1.ShowDialog(Me) = DialogResult.OK Then
            Application.DoEvents()
            Cursor.Current = Cursors.WaitCursor
            '----------------------------------
            Try
                Dim fs As New IO.FileStream(fMain.OpenFileDialog1.FileName, IO.FileMode.Open, IO.FileAccess.Read)
                ReDim localBytes(CInt(fs.Length) - 1)
                fs.Read(localBytes, 0, localBytes.Length)
                fs.Close() : fs = Nothing
                Try
                    localImage = Image.FromFile(fMain.OpenFileDialog1.FileName)
                Catch ex As Exception
                    localImage = Nothing
                End Try
                picImage.Invalidate()
                txtImage.Text = fMain.OpenFileDialog1.FileName
                btnOk.Enabled = Not mReadOnly
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
            '----------------------------------
            Cursor.Current = Cursors.Default
        End If

        btnRemove.Enabled = Not localBytes Is Nothing
        btnSave.Enabled = Not localBytes Is Nothing
    End Sub
    Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click
        Dim isEdit As Boolean

        If mCurrent.RowData Is Nothing Then
            mCurrent.RowData = mCurrent.DataView.AddNew
        Else
            If mCurrent.RowData.IsEdit Then
                isEdit = True
            Else
                mCurrent.RowData.BeginEdit()
            End If
        End If

        Application.DoEvents()
        Cursor.Current = Cursors.WaitCursor
        '----------------------------------
        Try
            If mBrowse.ContentField <> "" Then
                If txtImage.Text = "" Then
                    mCurrent.RowData(mBrowse.ContentField) = DBNull.Value
                Else
                    mCurrent.RowData(mBrowse.ContentField) = localBytes
                End If
            End If
            If mBrowse.PathField <> "" Then
                Select Case mBrowse.PathType
                    Case Model10.PathType.Complete : mCurrent.RowData(mBrowse.PathField) = txtImage.Text
                    Case Model10.PathType.DirectoryName : mCurrent.RowData(mBrowse.PathField) = IO.Path.GetDirectoryName(txtImage.Text)
                    Case Model10.PathType.Extension : mCurrent.RowData(mBrowse.PathField) = IO.Path.GetExtension(txtImage.Text)
                    Case Model10.PathType.FileName : mCurrent.RowData(mBrowse.PathField) = IO.Path.GetFileName(txtImage.Text)
                    Case Model10.PathType.FileNameWithoutExtension : mCurrent.RowData(mBrowse.PathField) = IO.Path.GetFileNameWithoutExtension(txtImage.Text)
                    Case Model10.PathType.FullPath : mCurrent.RowData(mBrowse.PathField) = IO.Path.GetFullPath(txtImage.Text)
                    Case Model10.PathType.PathRoot : mCurrent.RowData(mBrowse.PathField) = IO.Path.GetPathRoot(txtImage.Text)
                End Select
            End If
            DialogResult = DialogResult.OK
        Catch ex As Exception
            MsgBox(ex.Message)
            If Not isEdit Then mCurrent.RowData.CancelEdit()
        End Try
        '----------------------------------
        Cursor.Current = Cursors.Default
    End Sub
    Private Sub btnRemove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRemove.Click
        localImage = Nothing
        localBytes = Nothing
        picImage.Invalidate()
        txtImage.Text = ""
        btnOk.Enabled = Not mReadOnly

        btnRemove.Enabled = Not localBytes Is Nothing
        btnSave.Enabled = Not localBytes Is Nothing
    End Sub
    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
        If txtImage.Text = "" Then
            fMain.SaveFileDialog1.FileName = ""
            fMain.SaveFileDialog1.Filter = ""
        Else
            Dim f As String
            f = "*" & IO.Path.GetExtension(txtImage.Text)
            f = f & "|" & f

            fMain.SaveFileDialog1.FileName = IO.Path.GetFileName(txtImage.Text)
            fMain.SaveFileDialog1.Filter = f
            fMain.SaveFileDialog1.InitialDirectory = txtImage.Text
        End If
        If fMain.SaveFileDialog1.ShowDialog(Me) = DialogResult.OK Then
            Application.DoEvents()
            Cursor.Current = Cursors.WaitCursor
            '----------------------------------
            Try
                Dim fs As New IO.FileStream(fMain.SaveFileDialog1.FileName, IO.FileMode.OpenOrCreate)
                fs.Write(localBytes, 0, localBytes.Length)
                fs.Close()
                Process.Start(fMain.SaveFileDialog1.FileName)
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
            '----------------------------------
            Cursor.Current = Cursors.Default
        End If

        btnRemove.Enabled = Not localBytes Is Nothing
        btnSave.Enabled = Not localBytes Is Nothing
    End Sub
    Private Sub btnScan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScan.Click
        Application.DoEvents()
        Cursor.Current = Cursors.WaitCursor
        '----------------------------------
        Try
            Process.Start("mspview")
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        '----------------------------------
        Cursor.Current = Cursors.Default
    End Sub
    Private Sub cboSizeMode_SelectionChangeCommitted(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboSizeMode.SelectionChangeCommitted
        picImage.Invalidate()
    End Sub
    Private Sub picImage_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles picImage.Paint
        Try
            If localImage Is Nothing Then
                If localBytes Is Nothing Then
                    Dim sf As StringFormat = StringFormat.GenericDefault
                    sf.Alignment = StringAlignment.Center
                    sf.Trimming = StringTrimming.EllipsisPath
                    e.Graphics.DrawString("There is nothing to show...", picImage.Font, Brushes.White, New RectangleF(0, picImage.Height \ 2 - 8, picImage.Width, 16), sf)
                    sf = Nothing
                Else
                    Dim f As String
                    If txtImage.Text = "" Then
                        f = "Unknown File"
                    Else
                        f = IO.Path.GetFileName(txtImage.Text)
                    End If

                    Dim x As Integer = picImage.Width \ 2 - 16
                    Dim y As Integer = picImage.Height \ 2 - 16 - 8 - 1

                    e.Graphics.DrawImage(ImageList1.Images(1), New Point(x, y))

                    Dim sf As StringFormat = StringFormat.GenericDefault
                    sf.Alignment = StringAlignment.Center
                    sf.Trimming = StringTrimming.EllipsisPath
                    e.Graphics.DrawString(f, picImage.Font, Brushes.White, New RectangleF(0, y + 32 + 2, picImage.Width, 16), sf)
                    sf = Nothing
                End If
            Else
                Dim destRect As New Drawing.RectangleF(0, 0, picImage.Width, picImage.Height)
                If destRect.Width > 0 And destRect.Height > 0 Then
                    Dim srcRect As New Drawing.RectangleF
                    Select Case CType(cboSizeMode.SelectedItem, Model10.SizeMode)
                        Case Model10.SizeMode.Clip
                            If destRect.Width < localImage.Width Then
                                srcRect.X = (localImage.Width - destRect.Width) / 2
                                srcRect.Width = destRect.Width
                            Else
                                srcRect.X = 0
                                srcRect.Width = localImage.Width

                                destRect.X += (destRect.Width - localImage.Width) / 2
                                destRect.Width = localImage.Width
                            End If
                            If destRect.Height < localImage.Height Then
                                srcRect.Y = (localImage.Height - destRect.Height) / 2
                                srcRect.Height = destRect.Height
                            Else
                                srcRect.Y = 0
                                srcRect.Height = localImage.Height

                                destRect.Y += (destRect.Height - localImage.Height) / 2
                                destRect.Height = localImage.Height
                            End If
                        Case Model10.SizeMode.Stretch
                            srcRect = New Drawing.RectangleF(0, 0, localImage.Width, localImage.Height)
                        Case Model10.SizeMode.Zoom
                            srcRect = New Drawing.RectangleF(0, 0, localImage.Width, localImage.Height)
                            Dim destinationRate As Single = destRect.Width / destRect.Height
                            Dim imageRate As Single = CSng(localImage.Width / localImage.Height)
                            If destinationRate < imageRate Then
                                Dim p As Single = destRect.Width / imageRate
                                destRect.Y += (destRect.Height - p) / 2
                                destRect.Height = p
                            Else
                                Dim p As Single = destRect.Height * imageRate
                                destRect.X += (destRect.Width - p) / 2
                                destRect.Width = p
                            End If
                    End Select

                    Try
                        e.Graphics.DrawImage(localImage, Drawing.Rectangle.Truncate(destRect), Drawing.Rectangle.Truncate(srcRect), Drawing.GraphicsUnit.Pixel)
                    Catch ex As Exception
                        Dim x As Integer = picImage.Width \ 2 - 16
                        Dim y As Integer = picImage.Height \ 2 - 16 - 8 - 1

                        e.Graphics.DrawImage(ImageList1.Images(0), New Point(x, y))

                        Dim sf As StringFormat = StringFormat.GenericDefault
                        sf.Alignment = StringAlignment.Center
                        sf.Trimming = StringTrimming.EllipsisPath
                        e.Graphics.DrawString("Error for drawing image!", picImage.Font, Brushes.White, New RectangleF(0, y + 32 + 2, picImage.Width, 16), sf)
                        sf = Nothing
                    End Try
                End If
            End If
        Catch ex As Exception
            Trace.WriteLine(ex.Message, "Browse/picImage_Paint")
        End Try
    End Sub
    Private Sub picImage_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles picImage.Resize
        picImage.Invalidate()
    End Sub

    Public Property Browse() As Model10.Browse
        Get
            Return mBrowse
        End Get
        Set(ByVal Value As Model10.Browse)
            mBrowse = Value
        End Set
    End Property
    Public Property Current() As Model10.Current
        Get
            Return mCurrent
        End Get
        Set(ByVal Value As Model10.Current)
            mCurrent = Value
        End Set
    End Property
    Public Property [ReadOnly]() As Boolean
        Get
            Return mReadOnly
        End Get
        Set(ByVal Value As Boolean)
            mReadOnly = Value
        End Set
    End Property

    Public Sub Fill()
        Me.Text = GetSystemResource("Browse.Title") & " - " & mBrowse.Name
        If Not mCurrent.RowData Is Nothing Then
            If mBrowse.ContentField = "" Then
                If mBrowse.PathField = "" Then
                    localBytes = Nothing : localImage = Nothing
                Else
                    Dim obj As Object = mCurrent.RowData(mBrowse.PathField)
                    If IsDBNull(obj) Then
                        localBytes = Nothing : localImage = Nothing
                    Else
                        localBytes = Nothing : localImage = Image.FromFile(CStr(obj))
                    End If
                    obj = Nothing
                End If
            Else
                Dim obj As Object = mCurrent.RowData(mBrowse.ContentField)
                If IsDBNull(obj) Then
                    localBytes = Nothing : localImage = Nothing
                Else
                    Select Case TypeName(obj)
                        Case "Byte()"
                            localBytes = CType(obj, Byte()) : localImage = Model10.[Global].GetImage(CType(obj, Byte()))
                        Case "String"
                            localBytes = Nothing : localImage = Image.FromFile(CStr(obj))
                    End Select
                End If
                obj = Nothing
            End If

            If mBrowse.PathField = "" Then
                txtImage.Text = ""
            Else
                Dim obj As Object = mCurrent.RowData(mBrowse.PathField)
                If IsDBNull(obj) Then
                    txtImage.Text = ""
                Else
                    txtImage.Text = CStr(obj)
                End If
                obj = Nothing
            End If
        Else
            localBytes = Nothing : localImage = Nothing
            txtImage.Text = ""
        End If

        picImage.Invalidate()
        btnRemove.Enabled = Not localBytes Is Nothing
        btnSave.Enabled = Not localBytes Is Nothing

        btnOk.Enabled = False
    End Sub
End Class
